import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/medicine/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/medicine/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const getOne = (medicineNo,medicineSecurityNo,medicineName) => {
  return request({
    url: '/api/medicine/getOne',
    method: 'get',
    params: {
      medicineNo,
      medicineName,
      medicineSecurityNo
    }
  })
}
export const getMedicineName = (medicineName) => {
  return request({
    url: '/api/medicine/getMedicineName',
    method: 'get',
    params: {
      medicineName
    }
  })
}
export const getMedicineNo = (medicineNo) => {
  return request({
    url: '/api/medicine/getMedicineNo',
    method: 'get',
    params: {
      medicineNo
    }
  })
}

export const getMedicineSecurityNo = (medicineSecurityNo) => {
  return request({
    url: '/api/medicine/getMedicineSecurityNo',
    method: 'get',
    params: {
      medicineSecurityNo
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/medicine/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/medicine/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/medicine/update',
    method: 'post',
    data: row
  })
}

export const examine = (row) => {
  return request({
    url: '/api/medicine/examine',
    method: 'post',
    data: row
  })
}

